#ifndef __SERVER_SERVICER__
#define __SERVER_SERVICER__

#include "ServerBase.h"
#include "ServerBroadcaster.h"
#include "ServerObjectManager.h"
#include "ServerClientManager.h"


class network;
typedef int	message_code;


class servicer {
private:
	server_base*	m_pServer;
	broadcaster*	m_pBroadcaster;
	object_manager* m_pObjectManager;
	client_manager* m_pClientManager;
	
public:
	servicer(void);
	~servicer(void);

	void LinkServer(server_base* pServer);
	void LinkBroadcaster(broadcaster* pBroadcaster);
	void LinkObjectManager(object_manager* pObjectManager);
	void LinkClientManager(client_manager* pClientManager);
	
	bool RequestService(network* pServiceNetwork, message_code MessageCode, int ExtraLength, void* Extra);

	// Service Methods.
	bool Service(network* pServiceNetwork, service_msg_REQUEST_CODE* ReceiveData);
	bool Service(network* pServiceNetwork, service_msg_REQUEST_CLIENT* ReceiveData);
	bool Service(network* pServiceNetwork, service_msg_REQUEST_OBJECT* ReceiveData);
	bool Service(network* pServiceNetwork, service_msg_REQUEST_RELAY_LINK* ReceiveData);
	bool Service(network* pServiceNetwork, service_msg_NOTICE_NEW_OBJECT* ReceiveData);
	bool Service(network* pServiceNetwork, service_msg_NOTICE_DEL_OBJECT* ReceiveData);
	bool Service(network* pServiceNetwork, service_msg_NOTICE_ACCESS_OFF* ReceiveData);
	bool Service(network* pServiceNetwork, service_msg_NOTICE_MESSAGE* ReceiveData);	
	bool Service(network* pServiceNetwork, service_msg_NOTICE_MISSILE_CRUSH* ReceiveData);	
};


#endif